import { request } from '@/utils/request.js';

// 获取首页配置
export function getHomeConfig(data) {
  return request({
    url: '/home/configs/v2',
    method: 'post',
	data,
  });
}

// 商品搜索
export function getSearchGoods(data) {
  return request({
    url: '/goods/search',
    method: 'post',
	data,
  });
}

// 获取转链H5地址
export function getTransformLinkH5Url(data) {
  return request({
    url: '/agreement/list',
    method: 'post',
	data,
  });
}

// 获取热门关键词
export function getHotKeywords(data) {
  return request({
    url: '/goods/hotKeywords',
    method: 'post',
	data,
  });
}

// 获取榜单列表
export function getRankList(data) {
  return request({
    url: '/home/getAllRanks',
    method: 'post',
	data,
  });
}

// 获取商品有排序菜单
export function getGoodsSortMenu(data) {
  return request({
    url: '/home/sort/v2',
    method: 'post',
	data,
  });
}

// 获取商品详情接口
export function getGoodsDetail(data) {
  return request({
    url: '/goods/detail',
    method: 'post',
	data,
  });
}

// 获取相似推荐商品列表
export function getSimilarGoodsList(data) {
  return request({
    url: '/goods/recommend',
    method: 'post',
	data,
  });
}

// 获取商品的分享口令
export function getGoodsSharePwd(data) {
  return request({
    url: '/link/share',
    method: 'post',
	data,
	encryptionType: 'aes',
  });
}

// 收藏商品
export function collectGoods(data) {
  return request({
    url: '/collect/add',
    method: 'post',
	data,
	encryptionType: 'aes',
  });
}

// 取消收藏商品
export function cancelCollectGoods(data) {
  return request({
    url: '/collect/del',
    method: 'post',
	data,
	encryptionType: 'aes',
  });
}

// 拼多多授权
export function pddAuth(data) {
  return request({
    url: '/pdd/member/auth',
    method: 'post',
	data,
	encryptionType: 'aes',
  });
}